const api = require('api.js')

var login = function(code, userInfo, successCallback) {
  wx.request({
    url: api.api.login,
    data: {
      appID: api.appId,
      secret: api.secret,
      code: code,
      userInfo: userInfo
    },
    success: function() {
      successCallback()
    }
  })
}

module.exports.login = login